﻿using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Laoyang.Web.Filter
{
    public class CheckLoginFilter : IAuthorizationFilter
    {
        public void OnAuthorization(AuthorizationFilterContext filterContext)
        {
            if (filterContext.ActionDescriptor.DisplayName=="Login")
            {

            }
            else
            {
                ContentResult result = new ContentResult();
                result.Content = "没有登陆";
                filterContext.Result = result;
                //filterContext.Result = new RedirectResult("/Login/Index");
            }
        }
    }
}
